package org.example.retry;

import org.springframework.stereotype.Component;

@Component
public class Handler {

    /**
     * 0-返回false,1-返回true,其他抛出移除
     *
     * @param code
     * @return
     */
    public Boolean handle(Integer code) {
        System.out.println("Handler#handle,"+code);
        if (0 == code) {
            return false;
        } else if (1 == code) {
            return true;
        }
        throw new BusiException("业务异常");
    }
}
